<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%-- ssx --%>
<%-- 修改体验品信息 --%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>修改体验品信息</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<%-- 引用layui.css --%>
<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css" />
</head>

<body>
	<div id="userUpd">
		<form class="layui-form" action="" style="margin:40px;">
			
			<div class="layui-form-item">
				<label class="layui-form-label">商品ID</label>
				<div class="layui-input-block">
					<input type="text" name="goodsId" required 
						Readonly="false" autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">商品名称</label>
				<div class="layui-input-block">
					<input type="text" name="goods_name" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">商品价格</label>
				<div class="layui-input-block">
					<input type="text" name="common_price" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">商品规格</label>
				<div class="layui-input-block">
					<input type="text" name="specifications" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">商品类型</label>
				<div class="layui-input-block">
					<input type="text" name="goods_type" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">限额数量</label>
				<div class="layui-input-block">
					<input type="text" name="goods_destine_quota" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">库存数量</label>
				<div class="layui-input-block">
					<input type="text" name="goods_storage" required 
						 autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<hr class="layui-bg-gray">
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="updGoods">立即提交</button>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript" src="js/layui/layui.js"></script>
	<script type="text/javascript">
	layui.config({
        base: "<%=basePath%>/js/common/"
    }).use(["common", "element", "layer", "form", "table", "jquery"], function(){
			var elem = layui.element;
			var layer = layui.layer;
			var form = layui.form;
			var table = layui.table;
			var $ = layui.jquery;
			
			layui.common.init();
			
            //监听提交  
            form.on('submit(updGoods)', function(data){
                $.ajax({
                    type:"post",
                    url:'reservation/updateGoods.do',
                    data:data.field,
                    success : function(data){
                    	if(data.statusCode == 200){
                    		layer.msg(data.message,{icon : 5, time : 2000})
                    		//刷新父级 
			        	    table.reload('popedomLay');
			        	    //当你在iframe页面关闭自身时
			        	    var index = layer.getFrameIndex(window.name); //先得到当前iframe层的索引
			        	    layer.close(index); //再执行关闭
			        	    location.reload();
                    	}else{
                    		layer.msg(data.message,{icon : 6, time : 2000})
                    	}
                    }
                });
                return false;
            });
			
		});
	</script>
</body>
</html>
